package com.whater.sso.client.controller;

import java.security.Principal;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("test")
public class TestController {
	
	@RequestMapping(name="test",method = RequestMethod.GET)
	public ModelAndView test(HttpServletRequest request,HttpServletResponse response) {
		Principal principal = request.getUserPrincipal() ;
		ModelAndView modelAndView =	new ModelAndView("test") ;
		modelAndView.addObject("name", principal.getName());
		return modelAndView;
	}

}
